using PPIProxy;
using PPIDesktopClient.Entities;
using PPIDesktopClient.General;
using System;
using System.Data;
using System.Collections.Generic;
using VMind.Global;

namespace PPIDesktopClient.Logic
{
	public static class LUtility_Project
	{
		#region Query
        public static DataTable SelectAll()
		{
            ConfigReader _Reader = ConfigReader.GetInstance();
            return WUtility_Project.SelectAllIdName(_Reader.GetConnectionString()).Tables[0];
		}

        public static List<EUtility_Project> SelectAllIdName()
        {
            ConfigReader _Reader = ConfigReader.GetInstance();
            List<EUtility_Project> _projectList = new List<EUtility_Project>();
            EUtility_Project _project;
            DataTable _dt = WUtility_Project.SelectAllIdName(_Reader.GetConnectionString()).Tables[0];
            foreach (DataRow dr in _dt.Rows)
            {
                _project = new EUtility_Project(ConvertHelper.ToInt32(dr["Utility_ProjectId"]));
                _project.Name = ConvertHelper.Tostring(dr["Name"]);
                _projectList.Add(_project);
            }
            return _projectList;
        }
		#endregion Query
	}
}

